package com.offcn.question.config;


import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement
public class MyBatisConfig {

    @Bean
    public PaginationInterceptor paginationInnerInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //超出最大页码回调到首页
        paginationInterceptor.setOverflow(true);
        //单页最大数量
        paginationInterceptor.setLimit(1000);
        return paginationInterceptor;
    }
}
